package com.atguigu.UDP_a;

import java.io.IOException;
import java.net.*;

public class Send {
    public static void main(String[] args) throws Exception {

        DatagramSocket socket = new DatagramSocket();

        byte[] bytes = "今晚啤酒、烧烤、小龙虾~~~~".getBytes();
        InetAddress ip = InetAddress.getByName("127.0.0.1");
        int port = 6666;
        DatagramPacket packet = new DatagramPacket(bytes, bytes.length, ip, port);

        socket.send(packet);

        socket.close();

        System.out.println("客户端发送成功~~~~~");
    }
}
